//
//  IntroductionViewController.m
//  WayToHome
//
//  Created by A-01 on 2020/6/22.
//  Copyright © 2020 A-01. All rights reserved.
//

#import "IntroductionViewController.h"

@interface IntroductionViewController ()

@property (nonatomic, weak)UILabel * titleLab;
@property (nonatomic, weak)UILabel * showLabel;
@property (nonatomic, weak)UIImageView * rightImageView;

@end

@implementation IntroductionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.bottomImageView.hidden = YES;
    [self setupUI];
}


- (void)setupUI{
        
    UILabel * titleLab = [UILabel new];
    
    titleLab.text = self.titleStr;
    titleLab.textColor = [UIColor colorWithHexString:@"0AB966"];
    titleLab.font = [UIFont boldSystemFontOfSize:24];
    titleLab.textAlignment = NSTextAlignmentCenter;
        
    self.titleLab = titleLab;
        
    [self.view addSubview:self.titleLab];
    
    
    UILabel * showLabel = [UILabel new];
    
    showLabel.text = self.valueStr;
    showLabel.textColor = [UIColor colorWithHexString:@"0AB966"];
    showLabel.font = [UIFont boldSystemFontOfSize:16];
    showLabel.numberOfLines = 0;
        
    self.showLabel = showLabel;
        
    [self.view addSubview:self.showLabel];
    
    
    UIImageView * rightImageView = [UIImageView new];
       
    rightImageView.image = [UIImage imageNamed:@"home"];
       
    self.rightImageView = rightImageView;
       
    [self.view addSubview:self.rightImageView];
}


- (void)viewDidLayoutSubviews{

    [super viewDidLayoutSubviews];

    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.top.mas_equalTo(self.view).offset(15);
    }];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view).offset(35);
        make.bottom.mas_equalTo(self.view).offset(-35);
        make.trailing.mas_equalTo(self.view).offset(-25);
        make.width.mas_equalTo(380);
    }];
    
    [self.showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.view).offset(60);
        make.centerY.mas_equalTo(self.view);
        make.trailing.mas_equalTo(self.rightImageView.mas_leading).offset(-30);
    }];

    
    
    
}

@end
